<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>Mont Blanc Foot F7 - Dar de Alta Jugadores</title>

		<?php $this -> load -> view('head_view');?>

		<style type="text/css">
			#dialog-text {
				font-size: 62.5%;
			}
			/*demo page css*/
			#dialog_link {
				padding: .4em 1em .4em 20px;
				text-decoration: none;
				position: relative;
			}
			.add-players td {
				width: 400px;
			}
			#dialog_link span.ui-icon {
				margin: 0 5px 0 0;
				position: absolute;
				left: .2em;
				top: 50%;
				margin-top: -8px;
			}
		</style>
		<script language="javascript" type="text/javascript">
			$( function() {
				$("#submit-button").button();
			});
		</script>
	</head>
	<body id="page1">
		<div id="line-hor-create">
		</div>
		<div id="main-bg-top">
			<div id="main-bg-bot">
				<div id="main">
					<!-- header -->
					<div id="header">
						<?php $this -> load -> view('league_header');?>
					</div>
					<!-- content -->
					<div id="content">
						<!-- script -->
						<div id="indent">
							<!-- scroller news -->
							<div id="flexform">
								<h2>Encuentros del torneo <?php
								if($tournament_flag) { echo $tournament_name;
								}
							?></h2>
								<table class="matches-table">
									<tr>
										
										<?php
										if (!$tournament_flag){  ?>
										<th>
											<h4>Torneo</h4>
										</th> 
										<?php
										}
										?>
										<th>
										<h4>Equipo Casa</h4>
										</th>
										<th>
										<h4></h4>
										</th>
										<th>
										<h4>Equipo Visitante</h4>
										</th>
										<th>
										<h4>Hora del partido</h4>
										</th>
									</tr>
									<?php
										foreach($matches as $row) {
											$time = strtotime($row ->match_date);
											$timestamp = date('d-m-Y h:i A', $time);
									?>
									<tr>
										<?php
										if(!$tournament_flag) {
											echo "<td>" . $row -> tournament_name . "</td>";
										}
										?>
										<td>
										<?php echo $row->team_home
										?>
										</td>
										<td>VS</td>
										<td>
										<?php echo $row->team_visit
										?>
										</td>
										
										<td>
										<?php echo $timestamp ?>
										</td>
										<td>
											
										<?php
										
										$time = strtotime($row ->match_date);

										$timestamp = date('d-m-Y h:i A', $time);

										//echo $row->match_scored;
										//echo $timestamp . "<br>";
										
										if( $row -> match_scored == 0) {
											//ADD link to match add scores.
										?>
										<a href="<?php echo "/index.php/matches/edit/".$row ->match_id ?>" id="dialog_link" class="ui-state-default ui-corner-all" title="Agregar puntajes">
										<span class="ui-icon ui-icon-circle-triangle-e"></span>Editar Marcador</a>
										<?php } else {?>
										<a href="<?php echo "/index.php/matches/view/".$row ->match_id ?>" id="dialog_link" class="ui-state-default ui-corner-all" title="Agregar puntajes">
										<span class="ui-icon ui-icon-circle-triangle-e"></span>Ver Marcador</a>
										</a>
										<?php }?>
										</td>
									</tr>
									<?php }?>
								</table>
							</div>
							<div class="wrapper">
								<div id="column-left">
									<!-- Latest players added to league -->
									<!-- Team Administration -->
								</div>
							</div>
						</div>
					</div>
					<!-- footer -->
					<div id="footer">
						<?php $this -> load -> view('league_footer');?>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			$( function() {
				$("#faded").faded({
					speed: 500,
					autopagination: false,
					autoplay: 4000,
					autorestart: true,
					crossfade: true
				});
			});
		</script>
	</body>
</html>
